﻿using DXApplicationTangche.UC.订单一览新.订单预览新.service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.订单一览新.订单预览新
{
    public partial class Form更改订单收货地址 : DevExpress.XtraEditors.XtraForm
    {
        private String orderId { get; set; }
        private OrderCommitDTO返回 OrderCommitDTO返回 = new OrderCommitDTO返回();
        public Form更改订单收货地址(OrderCommitDTO返回 OrderCommitDTO返回)
        {
            InitializeComponent();
            this.OrderCommitDTO返回 = OrderCommitDTO返回;
            this.orderId = this.OrderCommitDTO返回.orderId;
            this.显示();
        }
        private void 显示()
        {
            this.textBox客户名.Text = this.OrderCommitDTO返回.customerName;
            this.textBox收件人姓名.Text = this.OrderCommitDTO返回.consignee;
            this.textBox手机号.Text = this.OrderCommitDTO返回.mobile;
            this.textBox省份.Text = this.OrderCommitDTO返回.addressProvince;
            this.textBox城市.Text = this.OrderCommitDTO返回.addressCity;
            this.textBox县区.Text = this.OrderCommitDTO返回.addressDistrict;
            this.textBox详细地址.Text = this.OrderCommitDTO返回.addressDetail;
            this.textBox邮编.Text = this.OrderCommitDTO返回.zipCode;
        }

        private void simpleButton确认_Click(object sender, EventArgs e)
        {
            PlainMessageResult PlainMessageResult = 
                更改订单收货地址Service.post修改地址(
                    this.orderId, 
                    this.textBox客户名.Text, 
                    this.textBox收件人姓名.Text,
                    this.textBox手机号.Text,
                    this.textBox省份.Text,
                    this.textBox城市.Text,
                    this.textBox县区.Text,
                    this.textBox详细地址.Text,
                    this.textBox邮编.Text
                    );
            if ("200".Equals(PlainMessageResult.errorCode))
            {
                MessageBox.Show("修改成功");
            }
            else
            {
                MessageBox.Show(PlainMessageResult.errorMessage);
            }
        }
    }
}
